package com.utils;

import java.io.FileReader;
import java.io.Reader;
import java.util.Properties;

import javax.sql.DataSource;

import org.apache.commons.dbcp.BasicDataSource;
import org.apache.commons.dbcp.BasicDataSourceFactory;

public class JDBCUtils3 {
	public static String drivername;
	public static String url;
	public static String username;
	public static String password;
	
	public static DataSource dataSource;
	static{
		try{
			Properties p=new Properties();
			Reader reader=new FileReader("jdbc.properties");
			p.load(reader);
			dataSource = BasicDataSourceFactory.createDataSource(p);
		}catch (Exception e) {
			e.printStackTrace();
		}
	}
	public static DataSource getDataSource(){
		return dataSource;
	}	
}
